package org.wangle.order;

import com.alibaba.nacos.api.config.annotation.NacosProperty;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.concurrent.TimeUnit;

@SpringBootApplication
@EnableDiscoveryClient
@EnableDubbo

public class OrderApplication {


    private static String name;
    public static void main(String[] args) throws Exception{
        ConfigurableApplicationContext run = SpringApplication.run(OrderApplication.class, args);
//        while(true) {
//            //当动态配置刷新时，会更新到 Enviroment中，因此这里每隔一秒中从Enviroment中获取配置
//            String userName = run.getEnvironment().getProperty("spring.datasource.url");
//            String userAge = run.getEnvironment().getProperty("user.age");
//            System.err.println("user name :" + userName + "; age: " + userAge);
//            System.out.println(name);
//            TimeUnit.SECONDS.sleep(1);
//        }
    }

}
